package action.grant;

import java.util.List;

import model.company.Companybasic;
import model.personal.Personalbasic;

import service.grant.GrantService;

import core.action.BaseAction;
import exception.Exceptions;

public class GrantCreateListAction extends BaseAction{
	
	private List<?> menu_name;
	private String flag;
	private String title;
	private Integer customid;
	private Integer cid;
	private String cname;
	private String ccode;
	private String ctype;
	private GrantService grantService;
	
	
	public String execute(){
		return "success";
	}
	public String showCompany(){
		menu_name=grantService.getCustomList("2");
		title="企业客户授信";
		flag="company";
		return "success";
	}
	public String showPersonal(){
		menu_name=grantService.getCustomList("1");
		title="个人客户授信";
		flag="personal";
		return "success";	
	}
	public String getCompany() throws Exceptions{
		Companybasic company=grantService.getCompanybasic(customid);
		cid=company.getId();
		cname=company.getName();
		ccode=company.getOrganizationcode();
		ctype="2";
		successResultValue="../grant/creditGrant";
		return "function";
	}
	public String getPersonal() throws Exceptions{
		Personalbasic personal=grantService.getPersonalbasic(customid);
		cid=personal.getId();
		cname=personal.getName();
		ccode=personal.getCertificatenumber();
		ctype="1";
		successResultValue="../grant/creditGrant";
		return "function";
	}
	

	//------Get/Set------//
	public List<?> getMenu_name() {
		return menu_name;
	}

	public void setMenu_name(List<?> menu_name) {
		this.menu_name = menu_name;
	}

	public Integer getCustomid() {
		return customid;
	}

	public void setCustomid(Integer customid) {
		this.customid = customid;
	}
	public GrantService getGrantService() {
		return grantService;
	}
	public void setGrantService(GrantService grantService) {
		this.grantService = grantService;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}
	public Integer getCid() {
		return cid;
	}
	public void setCid(Integer cid) {
		this.cid = cid;
	}
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	public String getCcode() {
		return ccode;
	}
	public void setCcode(String ccode) {
		this.ccode = ccode;
	}
	public String getCtype() {
		return ctype;
	}
	public void setCtype(String ctype) {
		this.ctype = ctype;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}

}
